<%--
  Created by IntelliJ IDEA.
  User: zhanzhongxin
  Date: 2021/8/5
  Time: 14:19
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<c:set var="name" value="zhangsan" scope="request"></c:set>
<c:if test="${ not empty name }">
    <h1>欢迎: ${name}</h1>
</c:if>

<c:if test="${empty name}">
    <h1>欢迎: xxx</h1>
</c:if>

<c:set var="age" value="20" scope="request"></c:set>

<c:choose>
    <c:when test="${age < 16}">
        <h1>少年:${age}</h1>
    </c:when>
    <c:when test="${age >= 16 && age <= 30}">
        <h1>青年:${age}</h1>
    </c:when>
    <c:when test="${age > 30 && age <= 50}">
        <h1>壮年:${age}</h1>
    </c:when>
    <c:otherwise>
        <h1>老年:${age}</h1>
    </c:otherwise>
</c:choose>
</body>
</html>
